/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Project;

import Common.IDocument;
import ComponentsUI.IPrimitiveModelFactory;
import ComponentsUI.IPrimitiveUI;
import Primitive.EPrimitiveType;
import Primitive.RectangleUI;
import java.awt.Point;

/**
 *
 * @author Администратор
 */
public class PrimitiveModelFactory implements IPrimitiveModelFactory {

    public IPrimitiveUI CreatePrimitiveModel(IDocument document, EPrimitiveType PrimitiveType,int x,int y) {
        IPrimitiveUI pui = CreatePrimitive(document, PrimitiveType,x,y);
        return pui;
    }

    private IPrimitiveUI CreatePrimitive(IDocument document, EPrimitiveType PrimitiveType, int x, int y) {
        IPrimitiveUI pui = null;
        if (EPrimitiveType.Rectangle == PrimitiveType) {
            pui = new RectangleUI(document,x,y);
        }
        return pui;
    }
}
